package com.test1.controller;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/user")
public class HelloController {

    @GetMapping
    public String getUser() {
        return "GET-张三";
    }

    @PostMapping
    public String saveUser() {
        return "POST-张三";
    }

    @PutMapping
    public String putUser() {
        return "PUT-张三";
    }

    @DeleteMapping
    public String deleteUser() {
        return "DELETE-张三";
    }

    //扩展点：如何把 _method 这个名字换成我们自己喜欢的

}
